package com.yinquan.util;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

import com.alibaba.fastjson.JSONObject;
import com.yishun.springboot.pojo.GwsLonggangquProjectDetailed;

public class GwsLoangGangQuUtil {

	public static JSONObject assemblyHrader(GwsLonggangquProjectDetailed detailed) {

		if (detailed == null) {
			return null;
		}

		JSONObject param = new JSONObject();

		LocalDateTime a = LocalDateTime.now();

		String time = a.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));

		param.put("api_key", detailed.getApiKey());
		param.put("project_code", detailed.getProjectCode());
		param.put("eng_code", detailed.getEngCode());
		param.put("api_version", "1.0");
		param.put("timestamp", time);

		return param;
	}

}
